<?php

class Application_Model_Immeuble
{
	protected $_idGestionnaire;
	protected $_nom;
	protected $_adresse;
	protected $_cp;
	protected $_ville;
	protected $_note;
	protected $_id;
	
	public function __construct(array $options = null)
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid user property');
		}
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid user property');
		}
		return $this->$method();
	}
	
	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	/**
	 * @return the $_idGestionnaire
	 */
	public function getIdGestionnaire() {
		return $this->_idGestionnaire;
	}

	/**
	 * @return the $_nom
	 */
	public function getNom() {
		return $this->_nom;
	}

	/**
	 * @return the $_adresse
	 */
	public function getAdresse() {
		return $this->_adresse;
	}

	/**
	 * @return the $_cp
	 */
	public function getCp() {
		return $this->_cp;
	}

	/**
	 * @return the $_ville
	 */
	public function getVille() {
		return $this->_ville;
	}

	/**
	 * @return the $_note
	 */
	public function getNote() {
		return $this->_note;
	}

	/**
	 * @return the $_id
	 */
	public function getId() {
		return $this->_id;
	}

	/**
	 * @param field_type $_idGestionnaire
	 */
	public function setIdGestionnaire($_idGestionnaire) {
		$this->_idGestionnaire = $_idGestionnaire;
	}

	/**
	 * @param field_type $_nom
	 */
	public function setNom($_nom) {
		$this->_nom = $_nom;
	}

	/**
	 * @param field_type $_adresse
	 */
	public function setAdresse($_adresse) {
		$this->_adresse = $_adresse;
	}

	/**
	 * @param field_type $_cp
	 */
	public function setCp($_cp) {
		$this->_cp = $_cp;
	}

	/**
	 * @param field_type $_ville
	 */
	public function setVille($_ville) {
		$this->_ville = $_ville;
	}

	/**
	 * @param field_type $_note
	 */
	public function setNote($_note) {
		$this->_note = $_note;
	}

	/**
	 * @param field_type $_id
	 */
	public function setId($_id) {
		$this->_id = $_id;
	}
	
}

